
using UnityEngine;

public class PlayerState_Jump : PlayerState
{
    [SerializeField]float jumpHeight = 1f;
    [SerializeField]float airMoveSpeed = 4f;
    [SerializeField]float airRunSpeed = 8f;
    private float weight => 0;
    private float currentAirSpeed; 
    public override void Enter()
    {
        motor.Jump(jumpHeight);
        currentAirSpeed = input.IsInputRun ? airRunSpeed : airMoveSpeed;
    }
    public override void LogicalUpdate()
    {
        if(motor.playerGravity.y <= 0)
        {
            manager.SwitchState(typeof(PlayerState_Fall));
        }
    }
    public override void PhysicalUpdate()
    {
        motor.SetMoveVelocity((currentAirSpeed - weight )* input.MoveValue);
        motor.UseGravity();
    }
}
